<?php get_header();?>

<!-- page content -->
<div class="container_24 main_container">
	    <div class="grid_24" style="overflow: hidden;">
	        <div class="breadcrumbs">
	            <?php if (function_exists('qt_custom_breadcrumbs')) qt_custom_breadcrumbs(); ?>
	        </div>
	    </div>
	    <div class="grid_24" style="border-bottom: solid 1px #777;margin-top: 5px;"></div>
       
		<?php get_sidebar();?>
		<?php if(is_post_type_archive('post')){?>
		<div class="grid_20">
			<div class="projects">
				    <ul class="gallery">
				    	<?php 				    					    	
				    	//$args = array('post_type'=>'post','posts_per_page'=> get_option("posts_per_page"),'paged'=>$paged);
				    	//query_posts($args);
				    	if(have_posts()){
				    	while (have_posts()): the_post();?>
						<?php 
							get_template_part('congtrinh','page');							
						?>	
						<?php endwhile;?>	
						<?php 
						}
						else
							echo '<li style="color:#b1b1b1;">Không tìm thấy bài viết.</li>'; 	
						?>		                
				    </ul>
				    
				    <div class="pagination">
					   <?php echo db_paginate();?>
				    </div>
				    
				</div>
		</div>
		<?php }
		else{
		?>
		<div class="grid_19 block">
	        <div class="page_detail" id="page-<?php the_ID();?>">
	            <h1 class="title"><?php 
	            if(is_tax())
	            {
	            	$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
	            	echo $term->name;
	            }
	            else
	           		post_type_archive_title();?></span></h1>
	           		
	            <?php if(have_posts()){?> 
	            <ul class="news">
	            <?php while (have_posts()): the_post();?>
				<?php get_template_part('search','page');?>	
				<?php endwhile;?>
			    
	            </ul>
	             <div class="pagination">
				   <?php echo db_paginate();?>
			    </div>
			    <?php 
	            }
	            else
			    	echo '<p style="color:#b1b1b1;">Không tìm thấy bài viết.</p>';
			    ?>
	        </div>
	    </div> 
	    <?php }?>
	
</div>
<!-- End page content -->

<?php get_footer();?>